<template>
	<view>
		<view class="menus">
			<img :src="avatar || '../../static/image/bg_img.png'" alt="">
			<view>
				<view class="bigs">{{nickname}}</view>
				<view class="grays grays1">{{bio}}</view>
			</view>
		</view>
		<!-- <view class="menus" @tap="channel()">
			<view class="bigs">附加消息  </view>
			<view class="grays">我是希望你过得</view>
		</view> -->
		<view class="btns">
			<view class="btnsa" @click="hm">发消息</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				nickname:'',
				avatar:'',
				friend_id:'',
				bio:''
			}
		},
		onShow() {
			this.$msgchat.initwork();
		},
		onLoad(option){
			this.friend_id = option.friend_id;
			this.initDat();
		},
		methods: {
			//初始数据
			initDat(){
				this.$common.requests('/api/index/userdetail',{uid: this.friend_id}).then(res => {
					if(res.data.code == 1){
						this.nickname = res.data.data.nickname;
						if(res.data.data.avatar != ''){
							this.avatar = this.$common.baseUrl + res.data.data.avatar;
						}
					}
				})
			},
			hm(){
				uni.navigateTo({
					url:"../HM-chat/HM-chat?friend_id="+this.friend_id+'&nickname=' + this.nickname
				})
			}
		}
	}
</script>

<style>
.menus{
	width: 92%;
	margin: 0 auto;
	border-bottom: solid 2upx #EEEEEE;
	padding: 20upx 0;
	display: flex;
	justify-content: space-between;
	align-items: center;
}
.menus>img:nth-child(1){
	width: 90upx;
	height: 90upx;
	border-radius: 10upx;
}
.menus>view:nth-child(2){
	width: 75%;
}
.menus>img:nth-child(3){
	width: 30upx;
	height: 30upx;
}
.bigs{
	font-size: 32upx;
}
.grays{
	color: #B6B5B5;
	font-size: 26upx;
}
.grays1{
	padding-top: 15upx;
}
.btns{
	position: fixed;
	bottom: 20%;
	width: 90%;
	left: 5%;
	display: flex;
	justify-content: center;
}
.btnsa{
	letter-spacing: 5upx;
	width: 100%;
	text-align: center;
	padding: 20upx 0;
	border-radius: 10upx;
	color: #FFFFFF;
	font-size: 30upx;
}
.btnsa{
	background: #39B54A;
}

.shenqing{
	color: gray;
	font-size: 35upx;
	position: fixed;
	bottom: 20%;
	width: 100%;
	text-align: center;
}
</style>
